const Koa = require('koa')
const koaBody = require('koa-body')
const cors = require('koa-cors')

// 开启socket
require('./utils/socket')

const app = new Koa()

const registerRouter = require('./router')

app.use(koaBody())
app.use(cors())
registerRouter(app)


const port = 3001
app.listen(port, () => {
  console.log(`服务器在${port}启动 ~ `)
})